import MesManager from "src/_T/Mes/MesManager";
import Task from "./Task";

export default class EverdyTask extends Task {
    // constructor(TaskData: _EveryDayConfig.DataType) {
    //     super();
    //     this.m_TaskData = TaskData;
    //     this.Init();
    // }
    /**初始化任务数据 */
    Init() {
        let strICon = this.m_TaskData.Icon;
        this.m_ResData = this.GetResICONById(Number(strICon));
        this.AchieveType = this.m_TaskData.AchieveType;
        this.m_TaskTypeOne = this.m_TaskData.TaskType;
        this.m_TaskTypTwo = this.GetTypeByETaskType(this.m_TaskData.TaskDoneType);
        let count = this.m_TaskTypeOne + "" + this.m_TaskTypTwo;
        MesManager.on(count, this, this.AddCurNumber);
    }

    /**增加值 */
    AddCurNumber() {
        console.log("增加了 " + this.m_TaskTypeOne + "" + this.m_TaskTypTwo);
        this.m_TaskData.CurNum = this.GetTaskNumber();
    }

    /**获取条件判定 */
    public GetTaskCondition(): boolean {
        //this.m_TaskData.CurNum = this.GetTaskNumber();
        if (this.m_TaskData.CurNum >= this.m_TaskData.CurMaxNum) return true;
        return false;
    }

    /**获取任务条件的值 */
    protected GetTaskNumber(type: any = this.m_TaskTypTwo): number {
        // switch (this.m_TaskTypeOne) {
        //     case ETaskType.Skill:
        //         return this.ETaskTypeSkill(type);
        //     case ETaskType.Creator:
        //         return this.ETaskTypeCreator(type);
        //     case ETaskType.collection:
        //         return this.ETaskTypecollection(type);
        //     case ETaskType.ACE:
        //         return this.ETaskTypeACE();
        //     case ETaskType.Chanllenge:
        //         return this.ETaskTypeChanllenge();
        //     case ETaskType.Building:
        //         return this.ETaskTypeBuilding(type);
        //     default:
        //         return 0;
        // }
        return 0;
    }

    //#region  根据类型2 获取对应的数值 
    /**击杀 */
    protected ETaskTypeSkill(): number {
        return 0;
    }
    /**生成 */
    protected ETaskTypeCreator(): number {
        return 0;
    }
    /**收集 */
    protected ETaskTypecollection(): number {

        return 0;
    }
    /**团灭 */
    protected ETaskTypeACE(): number {
        return 0;
    }
    /**挑战 */
    protected ETaskTypeChanllenge(): number {
        return 0;
    }
    /**建造与升级 */
    protected ETaskTypeBuilding(): number {
        return 0;
    }
    //#endregion

}